<?php
$T->loadTpl("./html/".$template."/".$qname.".html");
$T->SetTpl('cssjs','html/cssjs.inc'); 
$T->SetTpl('jsmodel','html/jsmodel.inc');     

$id=$_SESSION['uid'];
$sql="select a.*,b.name as idtypename,c.sch_name,d.rolename,e.name as dutytitlename,f.name as nationname,g.deptname,h.name as dutyname from sys_member a left join sys_dict b on a.idtype=b.id left join sys_school c on a.school=c.id left join sys_role d on ";
    $sql=$sql." a.role=d.id left join sys_dict e on a.dutytitle=e.id left join sys_dict f on a.nation=f.id left join sys_department g on a.department=g.id left join sys_dict h on a.duty=h.id where a.id='".$id."'";
$user=$T->db->query($sql)->fetch(PDO::FETCH_ASSOC);
if($user){
    $T->Set("id",$user["id"]);
    $T->Set("username",$user["username"]);
    $T->Set("nick",$user["nick"]);
    $T->Set("truename",$user["truename"]);
    $T->Set("used_name",$user["used_name"]);
    $T->Set("ename",$user["ename"]);
    $T->Set("sex",$user["sex"]);
    $T->Set("idnumber",$user["idnumber"]);
    $T->Set("worknum",$user["worknum"]);
    $T->Set("nation",$user["nation"]);
    $T->Set("political_status",$user["political_status"]);
    $T->Set("birthday",$user["birthday"]);
    $T->Set("areaid",$user["areaid"]);
    $T->Set("addr",$user["addr"]);
    $T->Set("email",$user["email"]);
    $T->Set("qq",$user["qq"]);
    $T->Set("mobile",$user["mobile"]);
    $T->Set("tel",$user["tel"]);
    $T->Set("hobbies",$user["hobbies"]);
    $T->Set("s_dutytitle",$user["dutytitlename"]);
    $T->Set("idtypename",$user["idtypename"]);
    $T->Set("deptname",$user["deptname"]);
    $T->Set("dutyname",$user["dutyname"]);
}

$T->Set("template",$template);         
$T->clearNaN();       
$T->clearNoN();
$T->display(); 